<template>
  <el-tabs v-model="activeTab" type="card" tab-position="left">
    <el-tab-pane label="通用" name="general">
      <GeneralSettings />
    </el-tab-pane>
    <!-- <el-tab-pane
      v-if="hasPermission(PermissionId.MEDICATION_SETTINGS)"
      label="药物管理"
      name="medication"
    >
      <MedicationSettings />
    </el-tab-pane> -->
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_REMINDER_SETTINGS)"
      label="提醒管理"
      name="reminder"
    >
      <ReminderSettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_SCENE_SETTINGS)"
      label="场景管理"
      name="scene"
    >
      <SceneSettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_ORDER_SETTINGS)"
      label="指令管理"
      name="order"
    >
      <OrderSettings />
    </el-tab-pane>
    <!-- <el-tab-pane v-if="hasPermission(PermissionId.ROUTE_SETTINGS)" label="路线管理" name="route">
      <RouteSettings />
    </el-tab-pane> -->
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_ROUTE_SETTINGS)"
      label="路线管理"
      name="route"
    >
      <RouteView />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_ALARM_SETTINGS)"
      label="设备管理"
      name="alarm"
    >
      <AlarmSettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_PHYSIOLOGICAL_SETTINGS)"
      label="生理阈值管理"
      name="physiological"
    >
      <PhysiologicalSettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_USER_MANAGEMENT)"
      label="用户设置管理"
      name="authority"
    >
      <AuthoritySettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_ROBOTFILE_SETTINGS)"
      label="机器文件管理"
      name="roobotfile"
    >
      <RoobotfileSettings />
    </el-tab-pane>
    <el-tab-pane
      v-if="hasPermission(PermissionId.PAGE_USERFILE_SETTINGS)"
      label="用户文件管理"
      name="userfile"
    >
      <UserfileSettings />
    </el-tab-pane>
  </el-tabs>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import GeneralSettings from './components/GeneralSettings.vue'
import PhysiologicalSettings from './components/PhysiologicalSettings.vue'
import AlarmSettings from './components/AlarmSettings.vue'
import MedicationSettings from './components/MedicationSettings.vue'
import ReminderSettings from './components/ReminderSettings.vue'
import SceneSettings from './components/SceneSettings.vue'
import OrderSettings from './components/OrderSettings.vue'
import RoobotfileSettings from './components/RoobotfileSettings.vue'
import UserfileSettings from './components/UserfileSettings.vue'
import RouteView from './components/RouteView.vue'
import AuthoritySettings from './components/AuthoritySettings.vue'
import RouteSettings from './components/RouteSettings.vue'
import { PermissionId } from '@/constants/permissions'
import { hasPermission } from '@/permission'

const activeTab = ref('general')
</script>

<style scoped lang="scss">
:deep(.el-tab-pane) {
  @apply h-full;
}
</style>
